package cn.classTest.mall.service.impl;

import cn.classTest.mall.mapper.RoleMapper;
import cn.classTest.mall.query.QueryObject;
import cn.classTest.mall.service.RoleService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import javax.management.relation.Role;
import java.util.List;

public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleMapper roleMapperImpl;
    @Override
    public void save(Role role) {
    }

    @Override
    public PageInfo<Role> query(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
        List<Role> roles = roleMapperImpl.selectAll();
        return new PageInfo<Role>(roles);
    }

    @Override
    public Role selectOne(Long id)  {
        return roleMapperImpl.selectOne(id);
    }
}
